<div class="doc-item" id="doc-727"><h2 class="doc-item-name">create-table<span class="namespace">(clojure.contrib.sql)</span></h2><ul class="var-arglists"><li>(<span class="var-name">create-table</span> name &amp; specs)</li></ul><div class="var-docstring"><p>Creates a table on the open database connection given a table name and
  specs. Each spec is either a column spec: a vector containing a column
  name and optionally a type and other constraints, or a table-level
  constraint: a vector containing words that express the constraint. All
  words used to describe the table may be supplied as strings or keywords.</p></div><div class="var-source"><pre>; clojure/contrib/sql.clj:101
(defn create-table
  [name &amp; specs]
  (do-commands
   (format &quot;CREATE TABLE %s (%s)&quot;
           (as-str name)
           (apply str
             (map as-str
              (apply concat
               (interpose [&quot;, &quot;]
                (map (partial interpose &quot; &quot;) specs))))))))</pre></div><div class="license"><p>Copyright (c) Rich Hickey. All rights reserved.</p><p>The use and distribution terms for this software are covered by the <a href="http://opensource.org/licenses/eclipse-1.0.php">Eclipse Public License 1.0</a>, which can be found in the file
          epl-v10.html at the root of this distribution. By using this software
          in any fashion, you are agreeing to be bound by the terms of this
          license. You must not remove this notice, or any other, from this
          software.</p></div></div>